'加减'
x=10
y=20
z=x+y
print(z)
'乘除'
a=3.14
b=2.718
c=a*b
print(c)
'字符串类型练习题'
name = "dongzesheng"
name_list = list(name)
fist_char = name_list[0]
sub_char = name_list[1:5]
upper_name = name.upper()
print(fist_char)
print(sub_char)
print(upper_name)
'列表类型练习题'
numbers = []
for i in range(1,11):
    numbers.append(i)
numbers_4_3 = numbers
numbers_4_3[4] = 100
'元组类型练习题'
colors = ("", "", "")
colors = list(colors)
colors.append("Beautiful")
colors[1] = "Girl"
colors = tuple(colors)
print(colors)
'字典类型练习题'
person = {
    "name":"dongzesheng",
    "age":""
    }
person.update({"home_town":"Enshi"})
person["age"] = 21
print(person)
del person["home_town"]
'百分制成绩转换为等级制成绩'
scoer = int(input())
if 90 <=scoer <=100:
    grade = 'A'
elif 80 <=scoer <90:
    grade = 'B'
elif 70 <=scoer <80:
    grade = 'C'
elif 60 <= scoer < 70:
    grade = 'D'
elif 0 <= scoer <60:
    grade = 'E'
else:
    grade= 'data error!'
print(grade)
CRAPS又称花旗骰，是美国拉斯维加斯非常受欢迎的一种的桌上赌博游戏。该游戏使用
两粒骰子，玩家通过摇两粒骰子获得点数进行游戏。简单的规则是：玩家第一次摇骰子如果摇出
了7点或11点，玩家胜；玩家第一次如果摇出2点、3点或12点，庄家胜；其他点数玩家继续摇
骰子，如果玩家摇出了7点，庄家胜；如果玩家摇出了第一次摇的点数，玩家胜；其他点数，
玩家继续要骰子，直到分出胜负。
"""
"""
user win: 的条件 7 or 11 第一次出现
zhuangjia win: 2 or 3 or 12

"""
"""
from random import randint

money = 10000

while money > 0:
    you_xi_ji_xu = False
    while True:
        debt = int(input("请下注："))
        if 0 < debt <= money:
            break
    
    first = randint(1,6) + randint(1,6)
    if first == 7 or first == 11: # user win
        print("玩家胜利！")
        money += debt
    elif first == 2 or first == 3 or first == 12:
        print("庄家胜利！")
        money -= debt
    else:
        you_xi_ji_xu = True
    while you_xi_ji_xu:
        you_xi_ji_xu = False
        current = randint(1,6) + randint(1,6)
        print("玩家摇出了%d点" % current)
        if current == 7:
            print("庄家胜利！")
            money -= debt
        elif current == first:
            print("玩家胜利！")
            money += debt
        else:
            you_xi_ji_xu = True
print("你破产了！")
"""
"""
水仙花数
"""
def is_shuixianhua(number):
    number_temp = list(number)
    a = int(number_temp[0])
    b = int(number_temp[1])
    c = int(number_temp[2])
    number_panduan = int(number)
    if number_panduan == a**3 + b**3 + c**3:
        result = True
    else:
        result = False
    return result

number_input = (input("请输入一个三位数字："))
a = is_shuixianhua(number_input)

if a == True:
    print("是水仙花数")
else:
    print("不是水仙花")
"""
number_temp = list(number_input)
a = int(number_temp[0])
b = int(number_temp[1])
c = int(number_temp[2])
number = int(number_input)
if number == a**3 + b**3 + c**3:
    print("是水仙花数")
    print(number)
"""

